<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/tips.js"></script>
<script type="text/javascript" src="${staticServer}/common/js/easydialog.min.js"></script>
<script src="${staticServer}/js/web/consultant_client_tracking_list.js?1.0"></script>

<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<script>
var contextPath='${contextPath}';
var lid
var lteacher
$(function(){
	$("#center").val("<#if center??>${center}</#if>")
	$("#state").val("<#if state??>${state}</#if>");
	$("#popBox").hide();
});
function makeSure(){
var state = $(':radio[name="flag"]:checked').val();

	if(confirm("确定审核？审核后无法恢复。")){
		$.post('${contextPath}/index/addState.json',{
			"id":lid,
			"teacher":lteacher,
			"state":state
		},function(data){
			if(data){
				if(data.msg=="1"){
					alert("审核成功!");
					easyDialog.close();	
					location.reload();
				}
			}
		});
	}
}

function cancelAction(){
	easyDialog.close();	
}
function mes(){
	//alert($(':radio[name="flag"]:checked').val());
}
function getState(id,teacher){
	lid = id;
	lteacher = teacher;
	easyDialog.open({
	  container : 'popBox',
	 callback:mes,
	  fixed : false
	});
}
function submit(){
	window.location.href="${contextPath}/index/liushuiList.htm?center="+$("#center").val()+"&type=${type}"+"&state="+$("#state").val()+"&type1="+$("#type1").val();
}
		function addToExcel() {
           		var  center=  $("#center").val();
           		var  state=  $("#state").val();
                $.post('${contextPath}/index/liushuiListXz.json',{
                    center:center,
                    state:state
                },function(data){
                    if(data){
                        if(data.name!=null){
                            window.location.href = "http://www.yueqiao.org/mydata/uploadtea/xls/" + data.name;
                        }
                    }
                });
        }
</script>
<style>
#popBox{background:#FFF;position:absolute;top:0px;left:center;border:1px solid #000;overflow:hidden;margin-top:10px;width:400px;z-index:2;}
.a_demo_one {
    background-color:#D0E6F3;
    padding:10px;
    position:relative;
    font-family: 'Open Sans', sans-serif;
    font-size:12px;
    text-decoration:none;
    color:#fff;
    border: solid 1px #831212;
    background-image: linear-gradient(bottom, rgb(171,27,27) 0%, rgb(212,51,51) 100%);
    border-radius: 5px;
} 
.a_demo_one:active {
    padding-bottom:9px;
    padding-left:10px;
    padding-right:10px;
    padding-top:11px;
    top:1px;
    background-image: linear-gradient(bottom, rgb(171,27,27) 100%, rgb(212,51,51) 0%);
}
</style>
</head>

<body>
<div id="popBox" ">
<div  style=" margin-top:0.5cm;" >
		<h2 align="center">审核意见</h2>
	</div>
	<div id="c00" style=" margin-top:0.5cm;" >
		<input name="flag"  type="radio" checked="checked" value="1"/> 通过 
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	             <input name="flag"  type="radio" value="2" /> 拒绝 
  </div>
  <div class="easyDialog_footer" style="float:right; margin-top:0.5cm; margin-right:1cm; margin-bottom:1cm;">
  <button  class="btn_highlight" id="easyDialogYesBtn" onclick="makeSure();">确定</button>
  <button class="btn_normal" id="easyDialogNoBtn" onclick="cancelAction();">取消</button>
  </div>
</div>
<input type="hidden" id="traId" value="">
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>资源统计管理</li>
			<li>&gt;</li>
			<li class="current">内部流水审核</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">流水记录列表<span style="color: red;margin-left: 20px">本位币余额:<#if yue??>${yue.moneys}<#else>0</#if></span></div>
		<table class="simple_table" rel="nohover" style="min-width: 750px;">
			<tr>
				<td>
				<label for="phone">中心地址：</label> 
				<select id="center">
					<option value="">全部</option>
					<#if clist??>
					<#list clist as list>
						<option value="${list.center}">${list.center}</option>
					</#list>
					</#if>
				<select>
				<label for="phone">审核状态：</label> 
				<select id="state">
					<option value="">全部</option>
					<option value="0">未审核</option>
					<option value="1">审核通过</option>
					<option value="2">审核拒绝</option>
				<select>
				<label for="phone">选择收入或支出：</label> 
				<select id="type1">
					<option value="">全部</option>
					<option value="1">内部流水收入</option>
					<option value="2">内部流水支出</option>
				<select>
			<!-- 	<a type="button" class="a_demo_one" href="${contextPath}/index/liushuiList.htm?type=1">内部流水收入</a>
				<a type="button" class="a_demo_one" href="${contextPath}/index/liushuiList.htm?type=2">内部流水支出</a>  -->
              	<td rowspan="4">
              	<input type="button" value=" 查 询 " onclick="submit()" />
              	<input type="button" value=" 下 载 " onclick="addToExcel()" />
			</tr>
		</table>
		<table>
			<tr class="fields">
				<th width="70">老师姓名</th>
				<th width="70">中心地址</th>
				<th width="100">科目名称</th>
				<th width="70">收款/付款日期</th>
				<th width="100">摘要</th>
				<th width="40">金额</th>
				<th width="80">备注</th>
				<th width="50">附件下载</th>
				<th width="50">审核状态</th>
				<th width="50">操作</th>
			</tr>
			<#if list??>
				<#list list as list>
				<tbody id="datas">
					<tr class="even_row">
						<td align="center"><#if list.is_has==1>${list.teacher}<#else>${list.tea_name}</#if></td>
						<td align="center"><#if list.tea_center??>${list.tea_center}<#else>${list.center}</#if></td>
						<td align="center">
							<#if list.type=="1">
								收入
							<#elseif list.type=="2">
								支出
							</#if>
						</td>
						<td align="center">${list.date}</td>
						<td align="center">${list.zhaiyao}</td>
						<td align="center">${list.moneys}</td>
						<td align="center">${list.beizhu}</td>
						<td>
						<#if list.fj_url?? && list.fj_url!="">
						<a href="http://www.yueqiao.org${list.fj_url}" >下载附件</a>
						<#else>
						<a href="" class="tosnmiddle_btn xun">暂无附件</a>
						</#if>
					    </td>
						<td align="center">
							<#if list.state=="0">
								未审核
							<#elseif list.state =="1">
								审核通过
							<#elseif list.state =="2">
								审核拒绝
							</#if>
						</td>
						<td align="center">
							<#if list.state=="0">
								<a herf="#" onclick="getState(${list.id},'${list.teacher}')">审核</a>
							<#else>
								<a style="color: #A2929F;" herf="#">审核</a>
							</#if>
						</td>
					</tr>
				</#list>
			</#if>
		</table>
	</div>
	<div id="pager">
	<ul id="pagination" style="padding-left: 14px">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
		<#if currpage==1 >
			<li class="previous-off">首页</li>
			<li class="previous-off">上一页</li>
			<#else>
			<li class="previous"><a href="${contextPath}/index/liushuiList.htm?currPage=1&type=${type}&state=${state}&center=${center}">首页</a></li>
			<li class="previous"><a href="${contextPath}/index/liushuiList.htm?currPage=${currpage-1}&type=${type}&state=${state}&center=${center}">上一页</a></li>
			</#if>
			<input type="hidden" id="total" value="${page.pagetotal}" />	
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/liushuiList.htm?currPage=${index_up}&type=${type}&state=${state}&center=${center}">${index_up}</a></li>
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/liushuiList.htm?currPage=${index_up}&type=${type}&state=${state}&center=${center}">${index_up}</a></li>
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/liushuiList.htm?currPage=${pagetotal}&type=${type}&state=${state}&center=${center}">${pagetotal}</a></li>
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/liushuiList.htm?currPage=1&type=${type}&state=${state}&center=${center}">1</a></li>
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/liushuiList.htm?currPage=${index_up}&type=${type}&state=${state}&center=${center}">${index_up}</a></li>
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/liushuiList.htm?currPage=${pagetotal}&type=${type}&state=${state}&center=${center}">${pagetotal}</a></li>
			<#else>
				<li><a href="${contextPath}/index/liushuiList.htm?currPage=1&type=${type}&state=${state}&center=${center}">1</a></li>
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/liushuiList.htm?currPage=${index_up}&type=${type}&state=${state}&center=${center}">${index_up}</a></li>
	           	</#if>
				</#list>  
			</#if>
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		 	<li class="previous-off">尾页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/liushuiList.htm?currPage=${currpage+1}&type=${type}&state=${state}&center=${center}">下一页</a></li>
			<li class="previous"><a href="${contextPath}/index/liushuiList.htm?currPage=${page.pagetotal}&type=${type}&state=${state}&center=${center}">尾页</a></li>
		</#if>
		<li class="previous"></li>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	<div class="emptyline"></div>
</body>
</html>